import 'package:flutter/material.dart';

class AboutSetting extends StatefulWidget {
  const AboutSetting({super.key});

  @override
  State<AboutSetting> createState() => _AboutSettingState();
}

class _AboutSettingState extends State<AboutSetting> {
  int grade = 0;
  String introduction = '自己做着玩的';

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context).colorScheme;

    return Scaffold(
      backgroundColor: Colors.grey[900],
      appBar: AppBar(
        elevation: 0,
        centerTitle: true,
        title: Text("开发人简介",style: TextStyle(color: Colors.white),),
        backgroundColor: Colors.grey[800],
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: (){
          setState(() {
            grade += 1;
            if(grade == 101){
              grade = 0;
            }
          });
        },
        backgroundColor: Colors.grey[800],
        child: Icon(Icons.add,color: Colors.white,),
      ),
      body: Padding(
        padding: EdgeInsets.fromLTRB(30, 40, 30, 0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Center(
              child: CircleAvatar(
                backgroundImage: AssetImage('assets/images/author.png'),
                backgroundColor: Colors.grey[900],
                radius: 50,
              ),
            ),
            Divider(
              height: 50,
              color: Colors.grey[900],
            ),
            Text(
              '姓名:',
              style: TextStyle(fontSize: 24,color: Colors.grey[600],letterSpacing: 2),
            ),
            Text(
              '周桢昀',
              style: TextStyle(fontSize: 24,color: Colors.amber,letterSpacing: 2),
            ),
            SizedBox(height: 30,),
            Text(
              '评分:',
              style: TextStyle(fontSize: 24,color: Colors.grey[600],letterSpacing: 2),
            ),
            Text(
              '$grade',
              style: TextStyle(fontSize: 24,color: Colors.amber,letterSpacing: 2),
            ),
            SizedBox(height: 30,),
            Row(
              children: [
                Icon(Icons.email,color: Colors.grey[600],),
                SizedBox(width: 10,),
                Text(
                  'benbendaozzy@gmail.com',
                  style: TextStyle(fontSize: 20,color: Colors.grey[600]),
                ),
              ],
            ),
            SizedBox(height: 30,),
            Card(
              color: Colors.grey[800],
              child: Padding(
                padding: EdgeInsets.all(10),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      "简介:",
                      style: TextStyle(fontSize: 18,color: Colors.grey[600],letterSpacing: 1),
                    ),
                    Text(
                      "$introduction",
                      style: TextStyle(fontSize: 16,color: Colors.grey[600],letterSpacing: 1),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
